package com.itcast.peft.entity.report;

import lombok.Data;

@Data
public class SystemScore {

    /**
     * 呼吸系统
     */
    private int breathingSystem;

    /**
     * 消化系统
     */
    private int digestiveSystem;

    /**
     * 内分泌系统
     */
    private int endocrineSystem;

    /**
     * 免疫系统
     */
    private int immuneSystem;

    /**
     * 循环系统
     */
    private int circulatorySystem;

    /**
     * 泌尿系统
     */
    private int urinarySystem;

    /**
     * 感觉系统
     */
    private int motionSystem;

    /**
     * 感官系统
     */
    private int senseSystem;

    public int accuracyScore(SystemScore ref) {
        // 累积八项数值
        int total = 0;
        total += Math.abs(breathingSystem - ref.breathingSystem);
        total += Math.abs(digestiveSystem - ref.digestiveSystem);
        total += Math.abs(endocrineSystem - ref.endocrineSystem);
        total += Math.abs(immuneSystem - ref.immuneSystem);
        total += Math.abs(circulatorySystem - ref.circulatorySystem);
        total += Math.abs(urinarySystem - ref.urinarySystem);
        total += Math.abs(motionSystem - ref.motionSystem);
        total += Math.abs(senseSystem - ref.senseSystem);
        return total <= 80 ? 1 : 0;
    }
}